package com.wc.trainTest.体育场散步计划;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/26 13:27
 * @description https://acm.creative3605.com/contest/68/problem/H
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            int a = sc.nextInt();
            int b = sc.nextInt();

            int res = ((a + b) % n + n) % n;
            if (res == 0){
                System.out.println(n);
            }else {
                System.out.println(res);
            }
        }
    }
}
